package com.csnf.controller;

import com.csnf.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/seataOrder")
public class OrderController {

    @Autowired
    OrderService orderService;

    //生成订单
    @RequestMapping("/addOrder")
    public String addOrder(String userId,String productCode,int count){
        int r = orderService.addOrder(userId,productCode,count);
        if(r>0){
            return "success";
        }else{
            return "fail";
        }
    }

}
